<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>4.使用展示语法完成参数合并</title>
</head>
<body>
    <script>
      let user = {name: "向军", age:22};
      let hd = {...user,lang: "zh"};
      console.log(hd); //{name: "向军", age: 22, lang: "zh"}
      //函数传参
      function upLoad(params){
        let config = {
          type:"*jpeg,*.png",
          size: 100000
        };
        config = { ...config,...params};
        console.log(config);
      }
      upLoad({type:"gif",size:99}); //{type: "gif", size: 99}

    </script>
</body>
</html>